package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.WRecordRechargeMapper;
import com.ruoyi.system.domain.api.WRecordRecharge;
import com.ruoyi.system.service.IWRecordRechargeService;

/**
 * 充值记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-22
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class WRecordRechargeServiceImpl implements IWRecordRechargeService
{
    @Autowired
    private WRecordRechargeMapper wRecordRechargeMapper;

    /**
     * 查询充值记录
     * 
     * @param id 充值记录主键
     * @return 充值记录
     */
    @Override
    public WRecordRecharge selectWRecordRechargeById(Long id)
    {
        return wRecordRechargeMapper.selectWRecordRechargeById(id);
    }

    /**
     * 查询充值记录列表
     * 
     * @param wRecordRecharge 充值记录
     * @return 充值记录
     */
    @Override
    public List<WRecordRecharge> selectWRecordRechargeList(WRecordRecharge wRecordRecharge)
    {
        return wRecordRechargeMapper.selectWRecordRechargeList(wRecordRecharge);
    }

    /**
     * 新增充值记录
     * 
     * @param wRecordRecharge 充值记录
     * @return 结果
     */
    @Override
    public int insertWRecordRecharge(WRecordRecharge wRecordRecharge)
    {
        wRecordRecharge.setCreateTime(DateUtils.getNowDate());
        return wRecordRechargeMapper.insertWRecordRecharge(wRecordRecharge);
    }

    /**
     * 修改充值记录
     * 
     * @param wRecordRecharge 充值记录
     * @return 结果
     */
    @Override
    public int updateWRecordRecharge(WRecordRecharge wRecordRecharge)
    {
        return wRecordRechargeMapper.updateWRecordRecharge(wRecordRecharge);
    }

    /**
     * 批量删除充值记录
     * 
     * @param ids 需要删除的充值记录主键
     * @return 结果
     */
    @Override
    public int deleteWRecordRechargeByIds(Long[] ids)
    {
        return wRecordRechargeMapper.deleteWRecordRechargeByIds(ids);
    }

    /**
     * 删除充值记录信息
     * 
     * @param id 充值记录主键
     * @return 结果
     */
    @Override
    public int deleteWRecordRechargeById(Long id)
    {
        return wRecordRechargeMapper.deleteWRecordRechargeById(id);
    }

    @Override
    public Integer selectWRecordRechargeTotal(String createTime) {
        return wRecordRechargeMapper.selectWRecordRechargeTotal(createTime);
    }
}
